<?php htmlTemplate('admin_header_frame.php');?>
<div class="title">设置菜单
<?php if ($user['isadmin']!=3){?>
<a  href="<?php echo MVC_WWW_HOST.'admin.php/admin/home/setmenu/'?>" class="title_button">菜单列表</a>
<?php }?>
</div>
<script type="text/javascript">
function checkForm(){	
	var pmodule = $.trim($("#pmodule").val());	
	var module = $.trim($("#module").val());
	var action = $.trim($("#action").val());
	var name = $.trim($("#name").val());
	var pid = $.trim($("#pid").val());
	var isuse = $.trim($("#isuse").val());
	var isshow = $.trim($("#isshow").val());
	var sort = $.trim($("#sort").val());
	var target = $.trim($("#target").val());
	 
	
	<?php
	if (@$row) {
		$url=MVC_WWW_HOST.'admin.php/admin/home/addmenu/do/update/id/'.$row['id'];
	}else{
		$url=MVC_WWW_HOST.'admin.php/admin/home/addmenu/do/add';
	}
	?>
	var url = '<?php echo $url;?>';
	
	$.post(url,{
		'pmodule':pmodule,
		'module':module,
		'action':action,
		'name':name,
		'pid':pid,
		'isuse':isuse,
		'isshow':isshow,
		'sort':sort,
		'target':target
		},function(rs){
			parent.showAlert(rs);
	})
	
	return false;
}
</script>

<form action="" method="post" onsubmit="return checkForm();">
<table style="width:100%;line-height: 35px;">
	
	
	<tr>
		<td align="right" width="30%">一级模块pmodule </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="pmodule" id="pmodule" value="<?php echo $row['pmodule'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="pmodule" id="pmodule" value="admin">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">模块module </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="module" id="module" value="<?php echo $row['module'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="module" id="module" value="home">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">动作action </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="action" id="action" value="<?php echo $row['action'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="action" id="action" value="test">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">动作名称name </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="name" id="name" value="<?php echo $row['name'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="name" id="name" value="测试">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">父ID pid  </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="pid" id="pid" value="<?php echo $row['pid'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="pid" id="pid" value="0">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">可用 isuse </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="isuse" id="isuse" value="<?php echo $row['isuse'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="isuse" id="isuse" value="1">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">是否显示isshow</td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="isshow" id="isshow" value="<?php echo $row['isshow'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="isshow" id="isshow" value="1">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">排序 sort </td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="sort" id="sort" value="<?php echo $row['sort'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="sort" id="sort" value="1">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right" width="30%">打开位置 target</td>
		<td align="left" width="70%" >		
		<?php if (@$row){?>
		<input type="text" style="width:200px;" name="target" id="target" value="<?php echo $row['target'];?>">
		<?php }else{?>
		<input type="text" style="width:200px;" name="target" id="target" value="mainframe">
		<?php }?>
		</td>		
	</tr>
	
	<tr>
		<td align="right"  width="30%" ><input type="submit" class="submit" value="确 认">&nbsp;</td>
		<td align="left"  width="70%" >&nbsp;</td>
		
	</tr>
	
	
</table>
</form>
<?php htmlTemplate('admin_footer_frame.php');?>